<ul id="type_menu">
<?
    foreach ($this->collection_type as $model_type)
    {
?>
        <li id="type_<?=$model_type->getID(); ?>">
            <a href="" <? if ($model_type->getID() == $this->id) echo "class=\"active\""; ?> onClick="ajaxTypes({id: <?=$model_type->getID(); ?>, action: 'view', use_inner: true, no_apply: true}); return false;"><?=$model_type->getCaption();?></a>
        </li>
<?
    };
?>
    <li class="add_item">
        <a href="" <? if ($this->id == -1) echo "class=\"active\""; ?>  onClick="addItem({menu: 'types', container: 'inner'}); return false;">Add new type</a>
    </li>
</ul>